using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WPCoco;
using WPCoco.Transitions;
using ParticlesDemo.Scenes;
using WPCoco.Controllers;
using Microsoft.Xna.Framework.Input.Touch;
using WPCoco.Audio;
using Microsoft.Xna.Framework.Media;

namespace ParticlesDemo
{
    public static class DemoManager
    {
        static Type[] scenes = new Type[] { typeof(SnowScene), typeof(SmokeScene), typeof(CometScene), typeof(LavaScene), 
                                            typeof(SpinningPeasScene), typeof(GalaxyScene), typeof(BoilingFoamScene),
                                            typeof(SunScene), typeof(PhoenixScene), typeof(BurstPipeScene),
                                            typeof(UpsideDownScene), typeof(ExplotionScene), typeof(TextureNodeScene) };

        static DemoManager()
        {
            ControllerManager.Shared.TouchScreen.Enabled = true;
        }

        static int index = 0;

        public static Scene GetCurrentScene() 
        {
            return Activator.CreateInstance(scenes[index]) as Scene;
        }

        public static void NextScene() 
        {
            index = (index + 1) % scenes.Length;
            Transition trans = new CrossFadeTransition(GetCurrentScene(), 0.5f);
            Coco.Shared.RunTransition(trans);
        }

        public static void BackScene()
        {
            index = (index - 1 + scenes.Length) % scenes.Length;
            Transition trans = new CrossFadeTransition(GetCurrentScene(), 0.5f);
            Coco.Shared.RunTransition(trans);
        }
        

    }
}
